<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <link rel="stylesheet" href="css/style_mxz.css"/>
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/script.js" charset="UTF-8"></script>
        <title>评论</title>
    </head>
    <body>
        <div class="container">
            <h2 class="page-heading">comments</h2>
            <div class="comment-wrapper">
                <form id="comment-form" class="comment-form">
                    <label class="comment-form__info">leave your comments</label>
                    <br><br>
                    <textarea class="comment-form__text" placeholder='Add you comment here' name="contents"></textarea>
                    <br><br>
                    <label for="selectRating">对此部电影的评分</label>
                    <select name="rating" id="selectRating" class="form-control">
                        <option value="1">⭐</option>
                        <option value="2">⭐⭐</option>
                        <option value="3">⭐⭐⭐</option>
                        <option value="4">⭐⭐⭐⭐</option>
                        <option value="5">⭐⭐⭐⭐⭐</option>
                    </select>
                    &nbsp; <br>
                    <button type='button' class="btn btn-danger comment-form__btn" id="comment_add">add comment</button>
                </form>

                <br>
                <div class="container">
                    <div class="comment-sets">

                        <!--*********************************************************************** class="comment comment--answer":回复-->

                        <c:forEach items="${commentList}" var="cl">

                            <div class="comment">
                                <div class="comment__images">
                                    <img alt='Ta的个人头像' src="../images/${cl[2]}">
                                </div>
                                <a href='#' class="comment__author"><span class="social-used fa fa-vk"></span>${cl[1]}</a>
                                <p class="comment__date">${cl[7]}<span class="comment__author" style="color: orange" >评分：${cl[8]}</span></p>
                                <p class="comment__message">${cl[5]}</p>
                                <a class="comment__reply" id="btn_showAddModal1" type="button">Reply</a>
                                <jsp:include page="/vmbrls_mxz?cid=${cl[3]}"></jsp:include>
                                </div>

                        </c:forEach>




                        <!--                        <div class="comment comment--answer">
                                                        <div class="comment__images">
                                                            <img alt='Ta的个人头像' src="../images/50x50.png" tppabs="http://placehold.it/50x50">
                                                        </div>
                                                        <a href='#' class="comment__author"><span class="social-used fa fa-vk"></span>Ice</a>
                                                        <p class="comment__date">2020/5/21 5:21<span class="comment__author" style="color: orange" >评分：5</span></p>
                                                        <p class="comment__message">看了一眼进度条，我从2分钟开始哭，真的从头哭到尾，泪点密集到仿佛枪林弹雨。藏了整整65年啊，对满世界快乐奔跑的异性情侣来说，爱是天主赐福是伟大唱诵。但对她们来说，爱却是每封情书必须把右下角的署名撕掉，以防其中一个人出了意外，也不会被人发现她们的爱。去tm的世界。</p>
                                                        <a href='#' class="comment__reply">Reply</a>
                                                        <a class="comment__reply" id="btn_showAddModal1" type="button">Reply</a>  
                                                        <a id="btn_showReply" type="button">查看回复</a>
                                                    </div>-->


                        <!--                         <div class="modal fade" id="reply_modal1" tabindex="-1">
                                                        <div class="modal-dialog">
                                                            <div class="modal-content">
                                                                <div class="modal-header">
                                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                                                    <h4 class="modal-title text-success" id="myModalLabel">此条消息的回复</h4>
                                                                </div>
                                                                <div class="modal-body">
                                                                    
                                                                </div>
                                                                
                                                            </div>
                                                        </div>
                                                    </div>-->






                        <div class="modal fade" id="add_modal1" tabindex="-1">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title text-success" id="myModalLabel">您的回复</h4>
                                    </div>
                                    <div class="modal-body">
                                        <form class="form-inline" id="add_form1">
                                            <label for="ireply">回复内容：</label>
                                            <textarea id="ireply" type="text" name="contents" placeholder="输入您的TA的回复：" class="form-control sinfo"></textarea>
                                            <br>

                                            <!--被回复用户标号-->
                                            <input name="usrid" type="text" style="display:none"  class="form-control" value="${cl[0]}">


                                            <!--回复哪个评论-->
                                            <input name="cid" type="text" style="display:none" class="form-control" value="${cl[3]}">


                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                                        <button type="button" id="btn_add1" class="btn btn-primary">保存</button>
                                    </div>
                                </div>
                            </div>
                        </div>


                        <!--**************************************************************************************************-->
                    </div>
                </div>                      
            </div>
            <div class="comment-more">
                <a href="Mycomment.jsp" class="watchlist">View my comments</a>
            </div>
        </div>
    </body>
</html>
